package com.ming.springbillmanager.contoller;

import com.ming.springbillmanager.dao.ProviderDao;
import com.ming.springbillmanager.entities.Provider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Collection;
import java.util.Map;

/**
 * @project_name: spring2
 * @description:
 * @author: arvin w ming
 * @create: 2022-09-07 09:15
 */

@Controller
public class ProviderController {


    @Autowired
    ProviderDao providerDao;

    @RequestMapping(value = "/providers",method = RequestMethod.GET)
    public String list(Map<String, Object>map){
        Collection<Provider> providerCollection = providerDao.getAll();
        map.put("providers",providerCollection);
        return "provider/list";
    }
}
